home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KNotesIface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  3.3 KB  |  104 lines

  1. /*******************************************************************
  2.  KNotesIface.h  --  This file defines the DCOP interface for KNotes.
  3.  
  4.  Copyright (C) 2000 by Adriaan de Groot
  5.                2001-2004 by Michael Brade <brade@kde.org>
  6.  
  7.  This program is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU General Public License
  9.  as published by the Free Software Foundation; either version 2
  10.  of the License, or (at your option) any later version.
  11.  
  12.  This program is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  GNU General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU General Public License
  18.  along with this program; if not, write to the Free Software
  19.  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. *******************************************************************/
  21.  
  22. #ifndef __KNotesIface_h__
  23. #define __KNotesIface_h__
  24.  
  25. #include <qstring.h>
  26. #include <qmap.h>
  27.  
  28. #include <dcopobject.h>
  29.  
  30.  
  31. class KNotesIface : virtual public DCOPObject
  32. {
  33.     K_DCOP
  34. k_dcop:
  35.     /**
  36.      * Create a new note.
  37.      * @param name the name (title) of the new note, if it is empty,
  38.      *        KNotes will choose an appropriate name
  39.      * @param text the body of the new note
  40.      * @return the new notes' id
  41.      */
  42.     virtual QString newNote( const QString& name = QString::null,
  43.                              const QString& text = QString::null ) = 0;
  44.  
  45.     /**
  46.      * Create a new note and inserts the current text in the clipboard
  47.      * as text.
  48.      *
  49.      * @param name the name (title) of the new note, if it is empty,
  50.      *        KNotes will choose an appropriate name
  51.      * @return the new notes' id
  52.      */
  53.     virtual QString newNoteFromClipboard( const QString& name = QString::null ) = 0;
  54.  
  55.     /**
  56.      * Deletes a note forever.
  57.      * @param noteId the id of the note to kill
  58.      */
  59.     virtual ASYNC killNote( const QString& noteId ) = 0;
  60.  
  61.     /**
  62.      * Deletes a note forever.
  63.      * @param noteId the id of the note to kill
  64.      * @param force do not request confirmation
  65.      */
  66.     virtual ASYNC killNote( const QString& noteId, bool force ) = 0;
  67.  
  68.     /**
  69.      * Get all the notes including their ids.
  70.      * @return a QMap that maps the id of a note to its name
  71.      */
  72.     virtual QMap<QString,QString> notes() const = 0;
  73.  
  74.     /**
  75.      * Changes the title/name of a note.
  76.      * @param noteId the id of the note to be modified
  77.      * @param newName the new title
  78.      */
  79.     virtual ASYNC setName( const QString& noteId, const QString& newName ) = 0;
  80.  
  81.     /**
  82.      * Sets the text of a note. This will delete the old text!
  83.      * @param noteId the id of the note
  84.      * @param newText the new text for the note
  85.      */
  86.     virtual ASYNC setText( const QString& noteId, const QString& newText ) = 0;
  87.  
  88.     /**
  89.      * Returns the title/name of a note.
  90.      * @param noteId the id of the note in question
  91.      * @return the name as a QString
  92.      */
  93.     virtual QString name( const QString& noteId ) const = 0;
  94.  
  95.     /**
  96.      * Returns the text of a note.
  97.      * @param noteId the id of the note in question
  98.      * @return the body as a QString
  99.      */
  100.     virtual QString text( const QString& noteId ) const = 0;
  101. };
  102.  
  103. #endif
  104.